<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">
	    <!-- Loading Bootstrap -->
	    <link href="./Public/Admin/Flat/dist/css/vendor/bootstrap.min.css" rel="stylesheet">
	    <!-- Loading Flat UI -->
	    <link href="./Public/Admin/Flat/dist/css/flat-ui.css" rel="stylesheet">
	    <link rel="shortcut icon" href="./Public/Admin/Flat/img/favicon.ico">
		<script type="text/javascript" src="Public/uploadify/jquery-1.8.2.min.js"></script>
		<script type="text/javascript" src="Public/uploadify/jquery.uploadify.min.js"></script>
		<link rel="stylesheet" type="text/css" href="Public/uploadify/uploadify.css">
		<!--		载入百度编辑器-->
		<script type="text/javascript" charset="utf-8" src="Public/Admin/ueditor1_4_3/ueditor.config.js"></script>
		<script type="text/javascript" charset="utf-8" src="Public/Admin/ueditor1_4_3/ueditor.all.min.js"> </script>
		<script type="text/javascript" charset="utf-8" src="Public/Admin/ueditor1_4_3/lang/zh-cn/zh-cn.js"></script>
	    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
	    <!--[if lt IE 9]>
	      <script src="dist/js/vendor/html5shiv.js"></script>
	      <script src="dist/js/vendor/respond.min.js"></script>
	    <![endif]-->
	</head>
	<body>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">

				<if condition="$is_show">
					<form action="{:U('add')}" method='post'>
				</if>
				<table class='table table-bordered table-hover'>
					<tr>
						<th>货品ID</th>
						<foreach name='spec' item='v'>
							<th>颜色</th>
							<th>尺码</th>
						</foreach>
						<th>库存</th>
						<th>货号</th>
						<th>操作</th>
					</tr>

					<foreach name='list' item='v'>
						<tr class="info">
							<td>111</td>
							<foreach name='v.spec' item='s'>
								<td>白色</td>
								<td>5.0</td>
							</foreach>
							<td>123</td>
							<td>123123213131</td>
							<td>
								<a href="{:U('edit', array('glid' => $v['glid']))}" class="btn btn-warning"><i class="icon-pencil icon-white"></i>修改</a>
								<a href="{:U('del', array('glid' => $v['glid']))}" class="btn btn-danger"><i class="icon-trash icon-white"></i>删除</a>
							</td>
						</tr>
					</foreach>

					<!-- 如果已添加数目小于可能情况数目，才出现添加货品的输入框 -->
					<if condition="$is_show">
						<tr class="info">
							<td>添加货品</td>

							<foreach name='spec' item='v'>
								<td>
									<select name="spec[]">
										<option value="0">-请选择-</option>
										<foreach name='v.opt' item='s'>
											<option value="{$s.gtid}">{$s.gtvalue}</option>
										</foreach>
									</select>
								</td>
							</foreach>


							<td>
								<input type="text" name='inventory'/>
							</td>
							<td>
								<input type="text" name='number' value="" />
							</td>
							<td>
								<input type="text" name='number' value="" />
							</td>
							<td></td>
						</tr>
					</if>
				</table>

				<if condition="$is_show">
					<input type="hidden" name='gid' value='{$Think.get.gid}'/>
					<input type="hidden" name='tid' value='{$Think.get.tid}'/>
					<input type="submit" value='保存添加' class="btn btn-primary"/>
					</form>
				</if>

			</div>
		</div>
	</div>


	</body>
</html>
